package org.fbk.it.hlt.jlsi;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class Percentili{
Map<Double, List<String>> map;
public Percentili() {
	map = new TreeMap<Double, List<String>>();
	}

public void add(Double score,String term) {
	if (!map.containsKey(score)){
		map.put(score, new LinkedList<String>());
	}
	map.get(score).add(term);
		
}
public int getSize(){
	int dim=0;
	for (double d : map.keySet()){
		dim+= map.get(d).size();
	}
	return dim;
}
public boolean contains(String Term){
	for (List<String> s : map.values()){
		for (String ss: s){
			if (ss.equalsIgnoreCase(Term))
				return true;
		}
	}
	return false;
}
}

